Skip to content

Nested lists#13

Open
lingwooc wants to merge 2 commits intobozzltron:masterfrom
lingwooc:nested_lists
Open

Nested lists#13
lingwooc wants to merge 2 commits intobozzltron:masterfrom
lingwooc:nested_lists

Conversation

@lingwooc
Copy link
Contributor

@lingwooc lingwooc commented Dec 30, 2016

Added the nested keyword. Doesn't really add much new code.

Appears to work for recursively nested lists for free (although it gets ugly quickly). Is also compatible with the complex templates layout.

Syntax is:

{	
	list: 'listName',
	item: {
		//map
		nestedList: 'referenceToNestedList'
	},
	nested: [{
		list: 'nestedList',
		item: {
			//map
		}
		//whatever you can normally use
	}]
}

You have to copy the list over using the normal map at the moment. Adding a to: node would mean you could reference the source data and avoid this line. In two minds about whether that is a good idea.

Limitation is you can't reference anything outside the nested list. This has the potential to get messy if done wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant